#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>
#include <assert.h>

void* my_memcpy(void* p1, void* p2, size_t num)
{
	assert(p1 && p2);
	void* ret = p1;

	while (num--)
	{
		*(char*)p1 = *(char*)p2;
		p1 = (char*)p1 + 1;
		p2 = (char*)p2 + 1;
	}
	return ret;
}
int main()
{
	int arr1[5] = { 1,2,3,4,5 };
	int arr2[10] = { 0 };
	my_memcpy(arr2, arr1, 5 * sizeof(arr1[0]));
	for (int i = 0; i < 10; i++)
		printf("%d ", arr2[i]);
	return 0;
}